#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int titleToNumber(char* columnTitle)
{
    int n = 0;
    while(*columnTitle != '\0')
    {
        n = n * 26  + *columnTitle++ - 64;
    }
    return n;
    
}


int main()
{
    char columnTitle[] = "Z";
   printf("%d\n",titleToNumber( columnTitle)) ;
    return 0;
}